#ifndef _SKILL_SHOW_H_
#define _SKILL_SHOW_H_

#include "utility.h"
#include <wx/panel.h>
#include <wx/dc.h>
#include <wx/timer.h>
#include <list>

class SkillShow: public wxPanel
{
public:
	SkillShow(wxWindow* parent,wxWindowID id=wxID_ANY,const wxPoint& pos=wxDefaultPosition,const wxSize& size=wxDefaultSize);
	virtual ~SkillShow();
	void ClearSkillList()
	{
		m_skillList.clear();
	}
	void SetSkillList(vector<SSkill> &skillList);
private:
	struct SDrawSkill
	{
		SActionInfo *pAction;
		size_t curFrame;
		size_t endFrame;
		int timeSpace;
		size_t skillListPos;
		SDrawSkill()
		{
			pAction = NULL;
			curFrame = 0;
			endFrame = 0;
			timeSpace = 0;
			skillListPos = -1;
		}
	};
	void OnPaint(wxPaintEvent& event);
	void OnBackground(wxEraseEvent &event);
	void OnTimer(wxTimerEvent &event);
	void Draw(wxDC &dc);
	bool DrawAction(wxDC &dc,SActionInfo &action,size_t &curFrame);

	bool AddPlayer();
	void DeletePlayer();

	wxTimer m_timer;
	vector<SSkill> m_skillList;
	list<SDrawSkill> m_drawSkillList;

	size_t m_curFrame;
	size_t m_curSkill;

	wxDECLARE_EVENT_TABLE();
};

#endif